gdkglcontext-win32.c: Fix Build on C89 Compilers
authorChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 13 Feb 2015 10:36:34 +0000 (18:36 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 13 Feb 2015 10:36:34 +0000 (18:36 +0800)
Make sure variables are declared at the top of the block.

gdk/win32/gdkglcontext-win32.c

index d32e531e6b6ac5a1d5c2069328119e3824d11eb2..df6132296c5e081706289c7cc455e9af1fb9ac52 100644 (file)
@@ -459,6 +459,11 @@ _gdk_win32_gl_context_realize (GdkGLContext *context,
   gint pixel_format;
   gboolean debug_bit, compat_bit;
 
+  /* request flags and specific versions for core (3.2+) WGL context */
+  gint flags = 0;
+  gint glver_major = 0;
+  gint glver_minor = 0;
+
   if (!_set_pixformat_for_hdc (context_win32->gl_hdc,
                                &pixel_format,
                                context_win32->need_alpha_bits))
@@ -469,12 +474,6 @@ _gdk_win32_gl_context_realize (GdkGLContext *context,
       return FALSE;
     }
 
-
-  /* request flags and specific versions for core (3.2+) WGL context */
-  gint flags = 0;
-  gint glver_major = 0;
-  gint glver_minor = 0;
-
   gdk_gl_context_get_required_version (context, &glver_major, &glver_minor);
   debug_bit = gdk_gl_context_get_debug_enabled (context);
   compat_bit = gdk_gl_context_get_forward_compatible (context);